package com.example.behaviorpattern.observer.impl;

import com.example.behaviorpattern.observer.MyMessage;
import com.example.behaviorpattern.observer.MyObserver;

/**
 * 具体观察者

 * @author yaojianfeng
 */

public record ConcreteObserver(String name) implements MyObserver {

    @Override
    public void update(MyMessage message) {
        System.out.println("Observer " + name + " received message: " + message.getMsg());
    }
}
